package com.chencong.online.function;

import com.chencong.online.bean.OrderEventBean;
import com.chencong.online.bean.OrderResultBean;
import org.apache.flink.cep.PatternSelectFunction;

import java.util.List;
import java.util.Map;

/**
 * @program: user-behavior-analysis-online
 * @ClassName OrderPattternSelectFunc
 * @description:正常处理事件匹配函数
 * @author: chencong
 * @create: 2022-01-05 18:48
 **/
public class OrderPatternSelectFunc implements PatternSelectFunction<OrderEventBean, OrderResultBean> {
    @Override
    public OrderResultBean select(Map<String, List<OrderEventBean>> pattern) throws Exception {
        Long orderId = pattern.get("pay").iterator().next().getOrderId();
        return new OrderResultBean(orderId, "正常支付数据");
    }
}
